package com.deer.wms.base.system.web.bill;

import com.deer.wms.base.system.model.bill.*;
import com.deer.wms.base.system.service.bill.BillInExceptionRecordService;
import com.deer.wms.common.core.controller.BaseController;
import com.deer.wms.common.core.domain.AjaxResult;
import com.deer.wms.common.core.page.TableDataInfo;
import com.deer.wms.common.utils.poi.ExcelUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 *异常区入库记录列表
 * @author 李帅辰
 * @date 2021/7/23 18:04
 * @return 
 */
@Controller
@RequestMapping("/in/billInExceptionRecord")
public class BillInExceptionRecordController  extends BaseController {
    private String prefix = "in/billInExceptionRecord";

    @Autowired
    private BillInExceptionRecordService billInExceptionRecordService;

    /**
     * 跳转页面
     * @return
     */
    @RequiresPermissions("in:billInExceptionRecord:view")
    @GetMapping("/page")
    public String workMaster()
    {
        return prefix + "/billInExceptionRecord";
    }



    //@RequiresPermissions("in:billInExceptionRecord:list")
    @PostMapping("/findList")
    @ResponseBody
    @Transactional
    public TableDataInfo findList(BillOutDetailStreamVo billOutDetailStreamVo) {
        startPage();
        List<BillOutDetailStreamVo> list = billInExceptionRecordService.findStreamList(billOutDetailStreamVo);
        return getDataTable(list);
    }

    /*出库查询报表导出*/
    //@RequiresPermissions("in:billInExceptionRecord:export")
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(BillOutDetailStreamVo billOutDetailStreamVo) {
        List<BillOutDetailStreamVo> list = billInExceptionRecordService.findStreamList(billOutDetailStreamVo);
        ExcelUtil<BillOutDetailStreamVo> util = new ExcelUtil<BillOutDetailStreamVo>(BillOutDetailStreamVo.class);
        return util.exportExcel(list, "出库记录");
    }
}
